﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SnakeDLL
{
	enum E_MoveDirection
	{
		Up,
		Down,
		Left,
		Right
	}
	class Icon
	{
		public int x;
		public int y;
		public string icon = "块";
		public E_MoveDirection moveDirection = E_MoveDirection.Right;
		public Icon(int x, int y)
		{
			this.x = x;
			this.y = y;
		}
		public void Show()
		{
			Console.SetCursorPosition(x, y);
			Console.ForegroundColor = ConsoleColor.Red;
			Console.Write(icon);
		}
		public void Hide()
		{
			Console.SetCursorPosition(x, y);
			Console.Write(" ");
		}
		public void Move()
		{
			Hide();
			switch (moveDirection)
			{
				case E_MoveDirection.Up:
					y--;
					break;
				case E_MoveDirection.Down:
					y++;
					break;
				case E_MoveDirection.Left:
					x -= 2;
					break;
				case E_MoveDirection.Right:
					x += 2;
					break;
			}
			Show();
		}
		public void ChangeDirection(E_MoveDirection newDirection)
		{
			moveDirection = newDirection;
		}
	}
	public class Class1
    {
    }
}
